﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsTools
{
    class SYSAPI
    {

        #region PMS 用户
        /// <summary>
        /// 保存PMS 用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void SavePMSUser(PMS_User user, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }
        /// <summary>
        /// 修改PMS 用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void EditPMSUser(PMS_User user, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }

        /// <summary>
        /// 删除PMS用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void DeletePMSUserById(string userId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }

      
        
        /// <summary>
        /// 根据ID获取PMS用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public PMS_User GetPMSUserById(string userId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
        }

        /// <summary>
        /// 获取PMS用户信息列表
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public IEnumerable<PMS_User> GetPMSUsers(string userName, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
                    }



        /// <summary>
        /// 检查PMS用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void CheckPMSUser(PMS_User user, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        { ///检查用户的UserCode不能重复        
        }



        
        #endregion

        #region PMS项目角色表
        /// <summary>
        /// 保存PMS项目角色表
        /// </summary>
        /// <param name="projectRole"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void SavePMSProjectRole(PMS_ProjectRole projectRole, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }

      
        /// <summary>
        /// 修改PMS项目角色表
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void EditPMSProjectRole(PMS_ProjectRole projectRole, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }

        /// <summary>
        /// 删除PMS项目角色表
        /// </summary>
        /// <param name="projectRoleId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void DeletePMSProjectRoleById(string projectRoleId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }

        /// <summary>
        /// 根据ID获取PMS项目角色表
        /// </summary>
        /// <param name="projectRoleId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public PMS_ProjectRole GetPMSProjectRolById(string projectRoleId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
        }

        /// <summary>
        /// 获取PMS项目角色表列表
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public IEnumerable<PMS_ProjectRole> GetPMSProjectRoles(string roleName, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }



        /// <summary>
        /// 检查PMS项目角色表
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void CheckPMSProjectRole(PMS_ProjectRole projectRole, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {    
            //名称重复，
        }



        #endregion

        #region PMS项目角色用户表
        /// <summary>
        /// 保存PMS项目角色用户表
        /// </summary>
        /// <param name="roleUser"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void SavePMSProjectRoleUser(PMS_ProjectRoleUser roleUser, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }
       
        /// <summary>
        /// 删除PMS项目角色用户表
        /// </summary>
        /// <param name="roleUserId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void DeletePMSProjectRoleUserById(string roleUserId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }

        /// <summary>
        /// 根据ID获取PMS项目角色用户表
        /// </summary>
        /// <param name="projectRoleId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public PMS_ProjectRoleUser GetPMSProjectRoleUserById(string roleUserId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
        }

        /// <summary>
        /// 根据项目标识，角色，获取项目角色用户列表
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="userCode"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public IEnumerable<PMS_ProjectRole> GetPMSProjectRoleUsers(string projectID, string projectRoleID, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
            //PMS_ProjectRole 包含 用户的属性 PMS_User
            //填充 PMS_User数据和 PMS_ProjectRoleUser 数据模型

        }

        /// <summary>
        /// 批量操作PMS项目角色表
        /// </summary>
        /// <param name="projectRole">key = add/del </param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void SavePMSProjectRole(IEnumerable<IDictionary<string, PMS_ProjectRole>> projectRoles, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
            //PMS_ProjectRole 定义包含关系的PMS_ProjectRoleUser 模型
        }

             


        /// <summary>
        /// 检查PMS项目角色用户表
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void CheckPMSProjectRole(PMS_ProjectRole projectRole, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
            //名称重复，
        }



        #endregion

        #region PMS项目角色权限表
        /// <summary>
        /// 保存PMS项目角色权限表
        /// </summary>
        /// <param name="rolePriv"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void SavePMSProjectRolePriv(PMS_ProjectRolePriv rolePriv, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
        }

        /// <summary>
        /// 删除PMS项目角色权限表
        /// </summary>
        /// <param name="roleUserId"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public void DeletePMSProjectRolePrivById(string rolePrivId, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
        }

        /// <summary>
        /// 根据ID获取PMS项目角色权限表
        /// </summary>
        /// <param name="rolePrivID"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public PMS_ProjectRolePriv GetPMSProjectRolePrivById(string rolePrivID, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {
        }

        /// <summary>
        ///  根据角色获取项目角色权限列表
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="userCode"></param>
        /// <param name="mapParms"></param>
        /// <param name="sReturnCode"></param>
        /// <param name="sReturnMsg"></param>
        public DataTable GetPMSProjectRolePrivs(string projectRoleID, Hashtable mapParms, out string sReturnCode, out string sReturnMsg)
        {

        }
        
        #endregion
    }


    class PMS_User
    {
        public string UserID { get; set; }
        public string UserCode { get; set; }
        public string UserName { get; set; }
        public string UserType { get; set; }
        public string UserStatus { get; set; }
        public string EMail { get; set; }
        public string MobileTelNo { get; set; }
        public string TelNo { get; set; }

        public string ModifiedBy { get; set; }
        public DateTime ModifiedAt { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    class PMS_ProjectRole
    {
        public string ProjectRoleID { get; set; }
        public string ProjectRoleName { get; set; }
        public string ProjectID { get; set; }
        public string ProjectRoleType { get; set; }

        public string ActiveFlag { get; set; }

        public string ModifiedBy { get; set; }
        public DateTime ModifiedAt { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedAt { get; set; }

        public PMS_ProjectRoleUser projectRoleUser { get; set; }
        public IEnumerable<PMS_User> sser { get; set; }

    }

    class PMS_ProjectRolePriv
    {
        public string RolePrivID { get; set; }
        public string ProjectID { get; set; }
        public string ProjectRoleID { get; set; }
        public string PrivCode { get; set; }
        public string PrivName { get; set; }
    }

    class PMS_ProjectRoleUser
    {
        public string RoleUserID { get; set; }
        public string UserCode { get; set; }
        public string ProjectID { get; set; }
        public string ProjectRoleID { get; set; }
        public string ProjectRoleName { get; set; }
        public string ProjectRoleType { get; set; }

    }
}
